Double Buffering Technique The .NET Way
Luckily we can achieve the same goal without any direct help from Win32 API. Image rendering in .NET is much simple and efficient than MFC. There are two functions in Graphics class to render your Image object on screen, these are DrawImage and DrawImageUnscaled. What makes these functions important is the fact that .NET always uses BitBlt in background to render the image on DC. So if we are able to do our off-screen drawing in an Image object, we can use these functions to render this object directly to DC and have the smooth animated effects. 

The technique is same, but the way to implement it differs a little bit. In the code fragment below, we are using a Bitmap object to do our off-screen drawing. In order to draw on some Image object, it must be attached to a Graphics object. We can create a new Graphics object from an Image object using the static member function, of Graphics, named FromImage. Once we get a Graphics object from some Image object, any drawing done on this Graphics object will actually be changing the Image. 

Bitmap offScreenBmp; 
Graphics offScreenDC; 
offScreenBmp = new Bitmap(this.Width, this.Height); 
offScreenDC = Graphics.FromImage(offScreenBmp); 

Provided that we have created offScreenDC as per shown in example above, we can implement the double buffering technique as per the code fragment below. 

Graphics clientDC = this.CreateGraphics(); 
// do drawing in offScreenDC 
// do drawing in offScreenDC 
// do drawing in offScreenDC 
clientDC.DrawImage(offScreenBmp, 0, 0); 

I will recommend this technique as it does not involve any call to Unmanaged code and is simpler in nature. 

Sample application uses this technique when you click the "Offscreen Drawing Using Image" radio button.

